﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c="clr-namespace:CiliaryDetector" 
        xmlns:avalonDock="http://avalondock.codeplex.com"
        xmlns:oxy="http://oxyplot.codeplex.com" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="CiliaryDetector.MainWindow"
        WindowState="Maximized"
        MinHeight="600"
        MinWidth="600"
        WindowStartupLocation="CenterScreen"
        Title="CBF"  x:Name="MainWnd">
    <Window.Resources>
        <c:RoundingConverter x:Key="RoundingConverter" />
        <c:SimpleConverter x:Key="SimpleConverter" />
    </Window.Resources>
    <Grid>
    	
    	<StackPanel Orientation="Vertical"  d:LayoutOverrides="Height">
    		<StackPanel>
        	
    			<StackPanel Orientation="Horizontal" Margin="0" d:LayoutOverrides="Height">
    				<Button HorizontalAlignment="Left" x:Name="btnOpen" Width="80" Click="btnOpen_Click" Height="70" Content="File Open" Margin="0,3.25" />
    				<Button Content="Capture" HorizontalAlignment="Left" x:Name="btnStart" Width="80" Click="btnStart_Click" Height="70" IsEnabled="False" Margin="5,0,0,0" />
    				<Button Content="Find Corner" x:Name="btnFeature" Width="80" Click="btnFeature_Click" Height="70" HorizontalAlignment="Left" IsEnabled="False" Margin="5,0,0,0" />
    				<Button Content="Play" Height="70" x:Name="btnRun" Width="80" IsEnabled="False" Click="btnRun_Click" Margin="5,0,0,0" />
    				<Button Content="Stop" Height="70" x:Name="btnStop" Width="80" IsEnabled="False" Click="btnStop_Click" Margin="5,0,0,0" />
    				<Button Content="Reset" Height="70" x:Name="btnReset" Width="80" IsEnabled="True" Click="btnReset_Click" Margin="5,0,0,0" />
    			</StackPanel>
    			<Border Margin="0" BorderThickness="1" CornerRadius="2" BorderBrush="#FFC0BDBD" Padding="2">
    				<StackPanel Orientation="Horizontal" Height="23.78" VerticalAlignment="Center" HorizontalAlignment="Left">
    					<Label Content="Frame Per Second(FPS) :" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    					<Label x:Name="lbFPS" Content="" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    					<Label Content="(Current Frame)" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"/>
    					<Label x:Name="lbCurNumFrame" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0" Content="0" />
    					<Label Content="/" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0"/>
    					<Label x:Name="lbTotalNumFrame" Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Content="0" />
    					<Label Content="(Total Frame)" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0"/>
    				</StackPanel>
        	
    			</Border>
        	
    		</StackPanel>
       
    		<avalonDock:DockingManager x:Name="dockingManager" MinHeight="550" Margin="0,2,0,0">
    			<avalonDock:LayoutRoot>
    				<avalonDock:LayoutPanel Orientation="Horizontal">
    					<avalonDock:LayoutDocumentPaneGroup Orientation="Vertical">
    						<avalonDock:LayoutDocumentPane>
    							<avalonDock:LayoutDocument Title="Video Window" x:Name="NestVideoWnd" CanClose="False" CanFloat="True">
    								<Canvas x:Name="RootImage" MouseLeftButtonDown="RootImage_MouseLeftButtonDown" MouseLeftButtonUp="RootImage_MouseLeftButtonUp" MouseMove="RootImage_MouseMove" Grid.Row="1">	
    									<Image x:Name="VideoWnd" MouseRightButtonDown="VideoWnd_MouseRightButtonDown" />
    								</Canvas>
    							</avalonDock:LayoutDocument>
    						</avalonDock:LayoutDocumentPane>
    						<avalonDock:LayoutDocumentPane>
    							<avalonDock:LayoutDocument Title="Waveform" x:Name="Histogram" CanClose="False" CanFloat="True">
    								<oxy:Plot x:Name="chart" Grid.Row="1" BorderThickness="0"/>
    							</avalonDock:LayoutDocument>
                            </avalonDock:LayoutDocumentPane>
    					</avalonDock:LayoutDocumentPaneGroup>
    					<avalonDock:LayoutAnchorablePaneGroup DockWidth="250" Orientation="Vertical">
    						<avalonDock:LayoutAnchorablePane>
    							<avalonDock:LayoutAnchorable Title="Property" CanClose="False" CanFloat="False" CanHide="False" CanAutoHide="False">
    								<Grid>
    									<StackPanel>
    										<TextBlock x:Name="tbRoi" Text="ROI is Disable." Margin="5,0,0,0" HorizontalAlignment="Left" Background="#FF020202" Foreground="#FFF5E20C" FontSize="13.333" />
    										<CheckBox x:Name="cbEnableOF" Content="Hide Optical Flow." Checked="cbEnableOF_Checked" Unchecked="cbEnableOF_Unchecked" Margin="5,10,0,0" HorizontalAlignment="Left" />
    										<Border Height="28.001" Width="99.746" HorizontalAlignment="Left" Margin="0,10,0,0">
    											<Grid>
    												<Label Content="Speed" x:Name="label3" HorizontalAlignment="Left" Margin="0,0,0,0.001" />
    												<TextBox x:Name="tbSpeed" Text="100" IsEnabled="True" Margin="45.747,2.5,-0.001,2.501" />
    											</Grid>
    										</Border>
    										<Border Height="28.001" Margin="0,10,0,0">
    											<Grid>
    												<Label Content="Feature Per Channel" x:Name="label2" Margin="0,0,54,0.001" d:LayoutOverrides="Width" />
    												<TextBox x:Name="tbFPC" Width="54" Text="400" HorizontalAlignment="Right" Margin="0,2.5,0,2.501" />
    											</Grid>
    										</Border>
    										<Border Height="28.001" Margin="0,10,0,0">
    											<Grid>
    												<Label Content="QualityLevel" x:Name="label1" HorizontalAlignment="Left" Margin="0,0,0,0.001" />
    												<Slider x:Name="levelslider" Maximum="1000" IsSnapToTickEnabled="True" LargeChange="0.1" SmallChange="1" TickPlacement="TopLeft" Interval="33" Value="{Binding CurVal, Mode=TwoWay}" ValueChanged="levelslider_ValueChanged" IsEnabled="False" Margin="77.22,2.5,54,2.501" />
    												<TextBox x:Name="tbQualityLevel" Width="54" IsEnabled="False" Text="{Binding CurVal, Converter={StaticResource RoundingConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextChanged="tbQualityLevel_TextChanged" HorizontalAlignment="Right" Margin="0,2.5,0,2.501" />
    											</Grid>
    										</Border>
    										<Border Height="29.78" Margin="0,10,0,0">
    											<Grid>
    												<Label VerticalAlignment="Center" VerticalContentAlignment="Center" Content="Amplitude "/>
    												<TextBox x:Name="tbAmp" TextWrapping="Wrap" HorizontalAlignment="Right" Margin="0" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Width="54" Height="23" Text="200" TextAlignment="Justify" TextChanged="tbAmp_TextChanged" />
    											</Grid>
    										</Border>
    										<Border Height="28.001" Margin="0,10,0,0">
    											<Grid>
    												<Label Content="Error Sensitivity " x:Name="label4" HorizontalAlignment="Left" Margin="0,0,0,0.001" />
                                                    <Slider x:Name="senseslider" Maximum="100" IsSnapToTickEnabled="True" LargeChange="0.1" SmallChange="1" TickPlacement="TopLeft" Interval="33" Value="{Binding Sense, Mode=TwoWay}" IsEnabled="True" Margin="100.623,2.5,54,2.501" ValueChanged="senseslider_ValueChanged" />
                                                    <TextBox x:Name="tbErrorSen" Width="54" IsEnabled="True" Text="{Binding Sense, Converter={StaticResource SimpleConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" HorizontalAlignment="Right" Margin="0,2.5,0,2.501" TextChanged="tbErrorSen_TextChanged" />
    											</Grid>
    										</Border>
    									</StackPanel>
    								</Grid>
    							</avalonDock:LayoutAnchorable>
    						</avalonDock:LayoutAnchorablePane>
    					</avalonDock:LayoutAnchorablePaneGroup>
    				</avalonDock:LayoutPanel>
    			</avalonDock:LayoutRoot>
    		</avalonDock:DockingManager>
    	
    	</StackPanel>
    	
    </Grid>
</Window>
